package com.claimSettlement.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.claimSettlement.mapper.LossDeterminationMapper;
import com.claimSettlement.pojo.CheLoss;
import com.claimSettlement.pojo.LossDetermination;
import com.claimSettlement.pojo.RenLoss;
import com.claimSettlement.pojo.WuLoss;
import com.claimSettlement.service.LossDeterminationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class LossDeterminationServiceImpl implements LossDeterminationService {
    @Resource
    LossDeterminationMapper lossDeterminationMapper;

    public int insLossDetermination(LossDetermination lossDetermination) {
        return lossDeterminationMapper.insLossDetermination(lossDetermination);
    }

    public LossDetermination getLossDeterminationByUserId(String caseId) {
        QueryWrapper<LossDetermination> queryWrapper = new QueryWrapper();
        queryWrapper.eq("caseId",caseId);
        return lossDeterminationMapper.selectOne(queryWrapper);
    }

    public Integer updateLossState(Map<String,Integer> map) {
        return lossDeterminationMapper.updateLossState(map);
    }
    public int delLossDetermination(String caseId) {
        QueryWrapper<LossDetermination> queryWrapper = new QueryWrapper<LossDetermination>();
        queryWrapper.eq("caseId",caseId);
        return lossDeterminationMapper.delete(queryWrapper);
    }

    public int updLossDetermination(LossDetermination lossDetermination) {
        return lossDeterminationMapper.updLossDetermination(lossDetermination);
    }

    public int selectZuiId() {
        return lossDeterminationMapper.selectZuiId();
    }

    public List<CheLoss> getCheLoss(String caseId) {
        return lossDeterminationMapper.getCheLoss(caseId);
    }

    public List<WuLoss> getWuLoss(String caseId) {
        return lossDeterminationMapper.getWuLoss(caseId);
    }

    public List<RenLoss> getRenLoss(String caseId) {
        return lossDeterminationMapper.getRenLoss(caseId);
    }

    public List<LossDetermination> getLossDataAll() {
        return lossDeterminationMapper.getLossDataAll();
    }


}
